"""
@author chende

数字水泥网爬虫

https://www.dcement.com/search/s.aspx?c=&f=0&wd=%u56de%u8f6c%u7a91&o=1&p=2
https://www.dcement.com/search/s.aspx?c=&f=0&wd=%u56de%u8f6c%u7a91&o=1&p=3
"""
#import requests

from urllib import request,parse
from bs4 import BeautifulSoup
import ssl

context = ssl._create_unverified_context()
url = 'https://www.dcement.com/search/s.aspx?c=&f=0&wd=%u56de%u8f6c%u7a91&o=1&p=3'
headers = {
    #假装自己是浏览器
    'User-Agent':' Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36',
}
dict = {
    'return_url':'https://biihu.cc/',
    'user_name':'xiaoshuaib@gmail.com',
    'password':'123456789',
    '_post_type':'ajax',
}
data = bytes(parse.urlencode(dict),'utf-8')
req = request.Request(url,data=data,headers=headers,method='GET')
response = request.urlopen(req,context=context)
soup2 = BeautifulSoup(response.read().decode('utf-8'),'lxml')

print(soup2.get_text())

